package com.leon.learnenginespace.drools.utils.operation.impl;

import com.leon.learnenginespace.drools.utils.operation.IOperationBase;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

/**
 * 等于
 *
 * @author DJ032474
 */
@Component
public class EqualsOperation implements IOperationBase {
    /**
     * v[1]==v[2]
     *
     * @param v 值
     * @return
     */
    @Override
    public Boolean operation(String dataType, Object... v) {
        Object v1 = v[0];
        Object v2 = v[1];
        return ObjectUtils.nullSafeEquals(v1, v2);
    }
}
